package cn.classTest.mall.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;
import org.apache.shiro.authz.Permission;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Role {
    private Long id;
    private String name;
    private  String sn;
    private List<Permission> permissions;
    private String json;

    public String getJson(){
        Map<String ,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        return JSON.toJSONString(map);

    }

}
